﻿/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
*******************************************************************************/

KindEditor.plugin('indent', function (K) {
    var self = this, name = 'indent';
    self.clickToolbar(name, function () {
        var self = this, doc = self.edit.doc;
        alert(self[0].innerHTML);
        if (self.afterTab) {
            self.afterTab.call(self, e);
            return;
        }
        var cmd = self.cmd, range = cmd.range;
        range.shrink();
        if (range.collapsed && range.startContainer.nodeType == 1) {
            range.insertNode(K('@&nbsp;', doc)[0]);
            cmd.select();
        }
        self.insertHtml('&nbsp;&nbsp;&nbsp;&nbsp;');
    });
});
